package cz.semjob.document.annotation;

import java.util.List;

import cz.semjob.document.annotation.metadata.Entity;
import cz.semjob.document.processing.DocumentInstance;
import cz.semjob.document.processing.DocumentWord;
import cz.semjob.document.util.DocumentUtil;

public class LabeledWords {
	
	private Entity label;
	private List<DocumentWord> words;
	
	public LabeledWords(Entity label, List<DocumentWord> words) {
		super();
		this.label = label;
		this.words = words;
	}

	public Entity getLabel() {
		return label;
	}

	public List<DocumentWord> getWords() {
		return words;
	}
	
	public int getStartIndex() {
		return DocumentUtil.getStartIndex(words);
	}
	
	public DocumentInstance getDocumentInstance() {
		return words.get(0).getSentence().getDocument();
	}
	public int getEndIndex() {
		return DocumentUtil.getEndIndex(words);
	}
	
	public String getText() {
		return DocumentUtil.printWords(words);
	}


	@Override
	public String toString() {
		return "LabeledWords [label=" + label.getName() + ", words=" + DocumentUtil.printWords(words) + "]";
	}
	
	
	
	

}
